<!DOCTYPE html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <title>简化页面</title>
</head>
<body>
<div class="wrapper">
    <div class="page">
        <header class="header"></header>
        <div class="bodyer">
            <div class="container-native">
        </div>
        <footer class="footer"></footer>
    </div>
</div>
<!-- 异步加载 -->
<script src="../../../../../vendor/require/2.1.20/require.min.js"></script>
<script>
  // $(function () {
  //   $('#JsonToExcel').click(function () {
  //     var data = {
  //         "title": [],
  //         "data": []
  //     };
  //     var th = document.querySelectorAll('#lists table>thead>tr>th');
  //     for (var i = 0; i < th.length; i++) {
  //         data.title.push(th[i].innerHTML);
  //     };
  //     var tdrs = document.querySelectorAll('#lists table>tbody>tr');
  //     for (var i = 0; i < tdrs.length; i++) {
  //         var ele = [];
  //         for (var j = 2; j <=4; j++) {
  //             ele.push(tdrs[i].childNodes[j].innerHTML);
  //         }
  //         data.data.push(ele);
  //     }
  //     if (data == '') {
  //         return;
  //     }
  //     JSONToExcelConvertor(data.data, "辅昊--电力", data.title);
  //   });
  // })
  require(['../js/excel.js'], function (excel) {
    var data = {
          "title": ['标题1', '标题2'],
          "data": [['1', 2], [3, 4]]
      };

      excel.JSONToExcelConvertor(data.data, "辅昊--电力", data.title);
  })
  
  </script>
</body>
</html>